package org.brain.pojos;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Messagetable entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "MESSAGETABLE", schema = "PUBLIC", catalog = "PUBLIC")
public class Messagetable implements java.io.Serializable {

	// Fields

	private int messageid;
	private Userinfo userinfo;
	private String messagecontent;
	private Integer messagetype;
	private String messagetitle;
	private String messagefrom;
	private Date messagetime;
	private String messageuser;

	// Constructors

	/** default constructor */
	public Messagetable() {
	}

	/** full constructor */
	public Messagetable(Userinfo userinfo, String messagecontent,
			Integer messagetype,String messagetitle,String messagefrom,Date messagetime,int messageid,String messageuser) {
		this.userinfo = userinfo;
		this.messagecontent = messagecontent;
		this.messagetype = messagetype;
		this.messagetitle=messagetitle;
		this.messagefrom=messagefrom;
		this.messagetime=messagetime;
		this.messageid=messageid;
		this.messageuser=messageuser;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "MESSAGEID", unique = true, nullable = false)
	public int getMessageid() {
		return this.messageid;
	}

	public void setMessageid(int messageid) {
		this.messageid = messageid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MESSAGEID", unique = true, nullable = false, insertable = false, updatable = false)
	public Userinfo getUserinfo() {
		return this.userinfo;
	}

	public void setUserinfo(Userinfo userinfo) {
		this.userinfo = userinfo;
	}

	@Column(name = "MESSAGECONTENT", nullable = false, length = 50)
	public String getMessagecontent() {
		return this.messagecontent;
	}

	public void setMessagecontent(String messagecontent) {
		this.messagecontent = messagecontent;
	}

	@Column(name = "MESSAGETYPE", nullable = false)
	public Integer getMessagetype() {
		return this.messagetype;
	}

	public void setMessagetype(Integer messagetype) {
		this.messagetype = messagetype;
	}
	@Column(name = "MESSAGETITLE", nullable = false, length = 50)
	public String getMessagetitle() {
		return messagetitle;
	}

	public void setMessagetitle(String messagetitle) {
		this.messagetitle = messagetitle;
	}
	@Column(name = "MESSAGEFROM", nullable = false, length = 30)
	public String getMessagefrom() {
		return messagefrom;
	}

	public void setMessagefrom(String messagefrom) {
		this.messagefrom = messagefrom;
	}
	@Column(name = "MESSAGETIME", length = 26)
	public Date getMessagetime() {
		return messagetime;
	}

	public void setMessagetime(Date messagetime) {
		this.messagetime = messagetime;
	}

	public void setMessageuser(String messageuser) {
		this.messageuser = messageuser;
	}
	@Column(name = "MESSAGEUSER", length =30)
	public String getMessageuser() {
		return messageuser;
	}

}